《计算机应用》唯一官方网站

• •    下一篇

基于端口注意力与通道空间注意力的网络异常流量检测

肖斌1,甘昀1,汪敏2,张兴鹏1,王照星3   

  1. 1.西南石油大学 计算机科学学院,成都 610500;2.西南石油大学 电气信息学院,成都 610500;
    3.中国石油川庆钻探工程有限公司,成都 610066


  • 收稿日期:2023-05-24 修回日期:2023-07-08 接受日期:2023-07-14 发布日期:2023-08-01 出版日期:2023-08-01
  • 通讯作者: 张兴鹏
  • 基金资助:
    四川省科技计划项目;西南石油大学科研启航计划

Network abnormal traffic detection based on port attention and convolutional block attention module

  • Received:2023-05-24 Revised:2023-07-08 Accepted:2023-07-14 Online:2023-08-01 Published:2023-08-01

摘要: 网络异常流量检测是网络安全保护中重要组成部分之一。目前,基于深度学习的异常流量检测方法都是将端口号属性与其他流量属性同等对待,忽略了端口号的重要性。为了提高异常流量检测性能,借鉴注意力思想,提出一个卷积神经网络(CNN)结合端口注意力(PAM)和通道空间注意力(CBAM)的网络异常流量检测模型。首先,将原始网络流量作为PAM的输入,分离出端口号属性送入全连接层,得到学习后的端口注意力权重值,并与其他流量属性点乘,输出端口注意后的流量数据;然后,将流量数据转换成灰度图,利用CNN和CBAM更充分地提取特征图在通道和空间上的信息;最后,使用焦点损失函数,以解决数据不平衡的问题。所提PAM具有参数量少、即插即用和普遍适用的优点。在CICIDS2017数据集上,所提模型的异常流量检测二分类任务准确率为99.18%,多分类任务准确率为99.07%,对于只有少数训练样本的类别也有较高的识别率。

关键词: 异常流量检测, 注意力机制, 数据不平衡, 轻量级网络, 通道空间注意力

Abstract: Network abnormal traffic detection is an important part of network security protection. At present, abnormal traffic detection methods based on deep learning treat the port number attribute the same as other traffic attributes, ignoring the importance of the port number. Considering the idea of attention, a novel abnormal traffic detection module based on Convolutional Neural Network (CNN) combining Port Attention Module (PAM) and Convolutional Block Attention Module (CBAM) was proposed to improve the performance of anomalous traffic detection. Firstly, the original network traffic was taken as the input of PAM, and the port number attribute was separated and sent to the full connection layer, and the learned port attention weight value was obtained, and the traffic data after port attention was output by multiplying with other traffic attribute points. Then, the traffic data was converted into grayscale map, and the CNN and CBAM were used to extract the information of the feature map on the channel and space more fully. Finally, the focus loss function was used to solve the problem of data imbalance. The proposed PAM has the advantages of small number of parameters, plug and play, and universal application. The accuracy rate of the model in this paper is 99.18% for the anomalous traffic detection dichotomous task and 99.07% for the multi-classification task on the CICIDS2017 dataset, and it also has a high recognition rate for classes with only a few training samples.

Key words: abnormal traffic detection, attention mechanism, data imbalance, lightweight network, Convolutional Block Attention Module (CBAM)
 

中图分类号: